TestMenu = {}

function TestMenu.Panel()  //creates the main panel for everything to be set on
	local DermaPanel = vgui.Create( "DFrame" )
	DermaPanel:SetTitle( "Testing Derma Stuff" )
	DermaPanel:ShowCloseButton(true)
	DermaPanel:SetBackgroundBlur( false )
	DermaPanel:SetPos( 50, 50 )
	DermaPanel:SetSize( 600, 600 )
	DermaPanel:SetVisible( true )
	DermaPanel:SetDraggable( true )
	DermaPanel:ShowCloseButton( true )
	DermaPanel:MakePopup()
	
	///////////////////////////////////////////////////////////////
	
	//creates the individual panels for the items to be run on
	local TestingPanel = vgui.Create( "DPanel", TestingPanel )
 TestingPanel:SetPos( 25, 50 )
 TestingPanel:SetSize( 250, 250 )
 TestingPanel.Paint = function() // Paint function
 surface.SetDrawColor( 50, 50, 50, 255 ) // Set our rect color below us; we do this so you can see items added to this panel
 surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() ) // Draw the rect
 end
 
 local TestingPanel2 = vgui.Create( "DPanel", TestingPanel2 )
 TestingPanel2:SetPos( 25, 50 )
 TestingPanel2:SetSize( 250, 250 )
 TestingPanel2.Paint = function() // Paint function
 surface.SetDrawColor( 50, 50, 50, 255 ) // Set our rect color below us; we do this so you can see items added to this panel
 surface.DrawRect( 0, 0, TestingPanel2:GetWide(), TestingPanel2:GetTall() ) // Draw the rect
 end
 
  local TestingPanel3 = vgui.Create( "DPanel", TestingPanel3 )
 TestingPanel3:SetPos( 25, 50 )
 TestingPanel3:SetSize( 250, 250 )
 TestingPanel3.Paint = function() // Paint function
 surface.SetDrawColor( 50, 50, 50, 255 ) // Set our rect color below us; we do this so you can see items added to this panel
 surface.DrawRect( 0, 0, TestingPanel3:GetWide(), TestingPanel3:GetTall() ) // Draw the rect
 end
 
 local TestingPanel4 = vgui.Create( "DPanel", TestingPanel4 )
 TestingPanel4:SetPos( 25, 50 )
 TestingPanel4:SetSize( 250, 250 )
 TestingPanel4.Paint = function() // Paint function
 surface.SetDrawColor( 50, 50, 50, 255 ) // Set our rect color below us; we do this so you can see items added to this panel
 surface.DrawRect( 0, 0, TestingPanel4:GetWide(), TestingPanel4:GetTall() ) // Draw the rect
 end
 
 /*local TestingPanel5 = vgui.Create( "DPanel", TestingPanel3 )
 TestingPanel5:SetPos( 25, 50 )
 TestingPanel5:SetSize( 250, 250 )
 TestingPanel5.Paint = function() // Paint function
 surface.SetDrawColor( 255, 50, 50, 255 ) // Set our rect color below us; we do this so you can see items added to this panel
 surface.DrawRect( 0, 0, TestingPanel5:GetWide(), TestingPanel5:GetTall() ) // Draw the rect
 end*/
 
 

//////////////////////////////////////////////////////////////////////////////// 
 ///////////////----------------------------------/////////////////////////////// 
 
 ///////////////----------------------------------///////////////////////////////  
 ///////////////-------------//////////-----------/////////////////////////////// 	
	   local PropertySheet = vgui.Create( "DPropertySheet" )
   PropertySheet:SetParent( DermaPanel )
   PropertySheet:SetPos( 40, 40 )
   PropertySheet:SetSize( 500, 500 )
 ///////////////-------------//////////-----------/////////////////////////////// 	
	
	
	//cost of deagle
	local deaglec = vgui.Create ("DLabel", TestingPanel)
	deaglec:SetText ("Cost:  $" .. GetGlobalInt("deaglecost"))
	deaglec:SetSize (80, 20)
	deaglec:SetPos (80,0)
	
	//cost of glock
	local glokc = vgui.Create ("DLabel", TestingPanel)
	glokc:SetText ("Cost:  $" .. GetGlobalInt("glockcost"))
	glokc:SetSize (80, 20)
	glokc:SetPos (80,20)
	
	//cost of five seven
	local fivec = vgui.Create ("DLabel", TestingPanel)
	fivec:SetText ("Cost:  $" .. GetGlobalInt("fivesevencost"))
	fivec:SetSize (80, 20)
	fivec:SetPos (80,40)
 
 //cost of p228
 local pc = vgui.Create ("DLabel", TestingPanel)
	pc:SetText ("Cost:  $" .. GetGlobalInt("p228cost"))
	pc:SetSize (80, 20)
	pc:SetPos (80,60)
 
 //////////////////////////////////////////////////////////
 //buy deagle
     bdeag = vgui.Create("DButton", TestingPanel)
	 bdeag:SetPos( 0, 0 )
	 bdeag:SetSize( 80, 20 )
  bdeag:SetText("deagle")
  bdeag.DoClick = function()
   RunConsoleCommand("say", "/buypistol deagle")
   end
   //buy glock
   bglok = vgui.Create("DButton", TestingPanel)
	 bglok:SetPos( 0, 20 )
	 bglok:SetSize( 80, 20 )
  bglok:SetText("glock")
  bglok.DoClick = function()
   RunConsoleCommand("say", "/buypistol glock")
   end
//buy p288
 bp = vgui.Create("DButton", TestingPanel)
	 bp:SetPos( 0, 60 )
	 bp:SetSize( 80, 20 )
  bp:SetText("p228")
  bp.DoClick = function()
   RunConsoleCommand("say", "/buypistol p228")
   end   
   
   //buyfiveseven
   bfive = vgui.Create("DButton", TestingPanel)
	 bfive:SetPos( 0, 40 )
	 bfive:SetSize( 80, 20 )
  bfive:SetText("fiveseven")
  bfive.DoClick = function()
   RunConsoleCommand("say", "/buypistol fiveseven")
   end
  
/////////////////////////////////////////////////////

//buy ammo pistol
	 bpist = vgui.Create("DButton", TestingPanel2)
	 bpist:SetPos( 0, 0 )
	 bpist:SetSize( 80, 20 )
  bpist:SetText("pistol")
  bpist.DoClick = function()
   RunConsoleCommand("say", "/buyammo pistol")
   end
  
  //buy ammo shotgun
 bshot = vgui.Create("DButton", TestingPanel2)
	 bshot:SetPos( 0, 20 )
	 bshot:SetSize( 80, 20 )
  bshot:SetText("shotgun")
  bshot.DoClick = function()
   RunConsoleCommand("say", "/buyammo shotgun")
   end  
   
   //buy ammo rifle
    brife = vgui.Create("DButton", TestingPanel2)
	 brife:SetPos( 0, 40 )
	 brife:SetSize( 80, 20 )
  brife:SetText("rifle")
  brife.DoClick = function()
   RunConsoleCommand("say", "/buyammo rifle")
   end  
  
  
  //ammo pistol cost
	local cpist = vgui.Create ("DLabel", TestingPanel2)
	cpist:SetText ("Cost:  $" .. GetGlobalInt("ammopistolcost"))
	cpist:SetSize (80, 20)
	cpist:SetPos (80,0)
	
	//ammo shotgun cost
	local cshot = vgui.Create ("DLabel", TestingPanel2)
	cshot:SetText ("Cost:  $" .. GetGlobalInt("ammoshotguncost"))
	cshot:SetSize (80, 20)
	cshot:SetPos (80,20)
	
	//cost of a rifle
	local crife = vgui.Create ("DLabel", TestingPanel2)
	crife:SetText ("Cost:  $" .. GetGlobalInt("ammoriflecost"))
	crife:SetSize (80, 20)
	crife:SetPos (80,40)
	
	////////////////////////////////////// 
	
	///creates the illegal filter
    
	
	
	//buy a shipment of ak's
	bak = vgui.Create("DButton", TestingPanel3)
	 bak:SetPos( 0, 0 )
	 bak:SetSize( 80, 20 )
	bak:SetSkin("redblack")
  bak:SetText("ak47")
  bak.DoClick = function()
   RunConsoleCommand("say", "/buyshipment ak47")
   end 

 bss = vgui.Create("DButton", TestingPanel3)
	 bss:SetPos( 0, 20 )
	 bss:SetSize( 80, 20 )
	 bss:SetSkin("redblack")
  bss:SetText("sniper")
  bss.DoClick = function()
   RunConsoleCommand("say", "/buyshipment sniper")
   end  
   
 
	
   //buy a shipment of mp5's
    bsmp = vgui.Create("DButton", TestingPanel3)
	 bsmp:SetPos( 0, 40 )
	 bsmp:SetSize( 80, 20 )
	 bsmp:SetSkin("redblack")
  bsmp:SetText("mp5")
  bsmp.DoClick = function()
   RunConsoleCommand("say", "/buyshipment mp5")
   end  
   
   //buy a shipment of m16s
   bsmsix = vgui.Create("DButton", TestingPanel3)
	 bsmsix:SetPos( 0, 60 )
	 bsmsix:SetSize( 80, 20 )
	 bsmsix:SetSkin("redblack")
  bsmsix:SetText("m16")
  bsmsix.DoClick = function()
   RunConsoleCommand("say", "/buyshipment m16")
   end  
   
   //buy shipment of shopguns
   bssh = vgui.Create("DButton", TestingPanel3)
	 bssh:SetPos( 0, 80 )
	 bssh:SetSize( 80, 20 )
	 bssh:SetSkin("redblack")
  bssh:SetText("shotgun")
  bssh.DoClick = function()
   RunConsoleCommand("say", "/buyshipment shotgun")
   end  
   
   //buys a shipment of mac10's
   bsmac = vgui.Create("DButton", TestingPanel3)
	 bsmac:SetPos( 0, 100 )
	 bsmac:SetSize( 80, 20 )
	 bsmac:SetSkin("redblack")
  bsmac:SetText("mac10")
  bsmac.DoClick = function()
   RunConsoleCommand("say", "/buyshipment mac10")
   end  
   

	
  /////
  //cost of mac10
	local cak = vgui.Create ("DLabel", TestingPanel3)
	cak:SetText ("Cost:  $" .. GetGlobalInt("ak47cost"))
	cak:SetSize (80, 20)
	cak:SetPos (80,0)

	//cost of sniper
	local csn = vgui.Create ("DLabel", TestingPanel3)
	csn:SetText ("Cost:  $" .. GetGlobalInt("snipercost"))
	csn:SetSize (80, 20)
	csn:SetPos (80,20)
	
	//cost of an mp5
	local cmp = vgui.Create ("DLabel", TestingPanel3)
	cmp:SetText ("Cost:  $" .. GetGlobalInt("mp5cost"))
	cmp:SetSize (80, 20)
	cmp:SetPos (80,40)
	
	//cost of the m16
	local cmone = vgui.Create ("DLabel", TestingPanel3)
	cmone:SetText ("Cost:  $" .. GetGlobalInt("m16cost"))
	cmone:SetSize (80, 20)
	cmone:SetPos (80,60)
	
	//cost of a shotgun
	local cshot = vgui.Create ("DLabel", TestingPanel3)
	cshot:SetText ("Cost:  $" .. GetGlobalInt("shotguncost"))
	cshot:SetSize (80, 20)
	cshot:SetPos (80,80)
  
  // cost of a mac10
  local cmac = vgui.Create ("DLabel", TestingPanel3)
	cmac:SetText ("Cost:  $" .. GetGlobalInt("mac10cost"))
	cmac:SetSize (80, 20)
	cmac:SetPos (80,100)
  
//////////////////////////////////////////////	
//buy a shipment of ak's
	bpist = vgui.Create("DButton", TestingPanel4)
	 bpist:SetPos( 0, 0 )
	 bpist:SetSkin("redblack")
	 bpist:SetSize( 80, 20 )
  bpist:SetText("druglab")
  bpist.DoClick = function()
   RunConsoleCommand("say", "/buydruglab")
   end 
  
  //buiy a shipment of snipers
 bss = vgui.Create("DButton", TestingPanel4)
	 bss:SetPos( 0, 20 )
	 bss:SetSize( 80, 20 )
  bss:SetText("microwave")
  bss.DoClick = function()
   RunConsoleCommand("say", "/buymicrowave")
   end  
   
   //buy a shipment of mp5's
    bsmp = vgui.Create("DButton", TestingPanel4)
	 bsmp:SetPos( 0, 40 )
	 bsmp:SetSize( 80, 20 )
  bsmp:SetText("gunlab")
  bsmp.DoClick = function()
   RunConsoleCommand("say", "/buygunlab")
   end  
   
   //buy a shipment of m16s
   bsmsix = vgui.Create("DButton", TestingPanel4)
	 bsmsix:SetPos( 0, 60 )
	 bsmsix:SetSize( 80, 20 )
  bsmsix:SetText("health")
  bsmsix.DoClick = function()
   RunConsoleCommand("say", "/buyhealth")
   end  
   ////////
   
   //cost of mac10
	local cak = vgui.Create ("DLabel", TestingPanel4)
	cak:SetText ("Cost:  $" .. GetGlobalInt("druglabcost"))
	cak:SetSize (80, 20)
	cak:SetPos (80,0)

	//cost of sniper
	local csn = vgui.Create ("DLabel", TestingPanel4)
	csn:SetText ("Cost:  $" .. GetGlobalInt("microwavecost"))
	csn:SetSize (80, 20)
	csn:SetPos (80,20)
	
	//cost of an mp5
	local cmp = vgui.Create ("DLabel", TestingPanel4)
	cmp:SetText ("Cost:  $" .. GetGlobalInt("gunlabcost"))
	cmp:SetSize (80, 20)
	cmp:SetPos (80,40)
	
	//cost of the m16
	local cmone = vgui.Create ("DLabel", TestingPanel4)
	cmone:SetText ("Cost:  $" .. GetGlobalInt("healthcost"))
	cmone:SetSize (80, 20)
	cmone:SetPos (80,60)

//////////////////////////////////////

PropertySheet:AddSheet( "pistols", TestingPanel, "gui/silkicons/world", false, false, "pistols" )
PropertySheet:AddSheet( "ammunition", TestingPanel2, "gui/silkicons/box", false, false, "ammo" )
PropertySheet:AddSheet( "rifles/shipment", TestingPanel3, "gui/silkicons/shield", false, false, "shipment" )
PropertySheet:AddSheet( "other", TestingPanel4, "gui/silkicons/shield", false, false, "other junk" )
///////////////////////////////////////////////////////////////	
	DermaPanel:RequestFocus( )
end

function onChat( playerindex, playername, text )
	if (text == "!testbox") then
		TestMenu.Panel()
	end
end

hook.Add( "ChatText", "ChatTextHook", onChat )